package com.atlas.alpha;
import android.content.*;
import android.database.sqlite.*;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.*;
/*
 * This file will be use to create a new DB, 
 * when no database exists in disk and the helper class
 * will do the needful for us. Also this class will be help us 
 * to upgrade the version of the DB if required.
 * */
public class DataBaseHelper extends SQLiteOpenHelper {
	public DataBaseHelper(Context context, String name, CursorFactory factory, int version){
		super(context,name,factory,version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(LoginDataBaseAdapter.DATABASE_CREATE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		Log.w("TaskDBAdapter", "Upgrading from " + oldVersion + " to " + newVersion + ", all data will be deleted.");
		db.execSQL("DROP TABLE IF EXISTS " + "TEMPLATE");
		onCreate(db);
	}
}
